package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OldPeopleOrderMapper;
import com.ruoyi.system.domain.OldPeopleOrder;
import com.ruoyi.system.service.IOldPeopleOrderService;

/**
 * 老年服务订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-05
 */
@Service
public class OldPeopleOrderServiceImpl implements IOldPeopleOrderService 
{
    @Autowired
    private OldPeopleOrderMapper oldPeopleOrderMapper;

    /**
     * 查询老年服务订单
     * 
     * @param oId 老年服务订单ID
     * @return 老年服务订单
     */
    @Override
    public OldPeopleOrder selectOldPeopleOrderById(Long oId)
    {
        return oldPeopleOrderMapper.selectOldPeopleOrderById(oId);
    }

    /**
     * 查询老年服务订单列表
     * 
     * @param oldPeopleOrder 老年服务订单
     * @return 老年服务订单
     */
    @Override
    public List<OldPeopleOrder> selectOldPeopleOrderList(OldPeopleOrder oldPeopleOrder)
    {
        return oldPeopleOrderMapper.selectOldPeopleOrderList(oldPeopleOrder);
    }

    /**
     * 新增老年服务订单
     * 
     * @param oldPeopleOrder 老年服务订单
     * @return 结果
     */
    @Override
    public int insertOldPeopleOrder(OldPeopleOrder oldPeopleOrder)
    {
        oldPeopleOrder.setCreateTime(DateUtils.getNowDate());
        return oldPeopleOrderMapper.insertOldPeopleOrder(oldPeopleOrder);
    }

    /**
     * 修改老年服务订单
     * 
     * @param oldPeopleOrder 老年服务订单
     * @return 结果
     */
    @Override
    public int updateOldPeopleOrder(OldPeopleOrder oldPeopleOrder)
    {
        oldPeopleOrder.setUpdateTime(DateUtils.getNowDate());
        return oldPeopleOrderMapper.updateOldPeopleOrder(oldPeopleOrder);
    }

    /**
     * 批量删除老年服务订单
     * 
     * @param oIds 需要删除的老年服务订单ID
     * @return 结果
     */
    @Override
    public int deleteOldPeopleOrderByIds(Long[] oIds)
    {
        return oldPeopleOrderMapper.deleteOldPeopleOrderByIds(oIds);
    }

    /**
     * 删除老年服务订单信息
     * 
     * @param oId 老年服务订单ID
     * @return 结果
     */
    @Override
    public int deleteOldPeopleOrderById(Long oId)
    {
        return oldPeopleOrderMapper.deleteOldPeopleOrderById(oId);
    }
}
